浏览 389 次
| 作者 | 正文 |
|
遍历list,有属性name,filmdate,将名字和日期相同的合并单元格
<logic:present name="list">
<table border="1" id="filmTable">
<logic:iterate id="list" name="list">
<tr>
<td >
<bean:write name="list" property="name" />
</td>
<td>
<bean:write name="list" property="filmdate" />
</td>
<td>
<bean:write name="list" property="filmtime" />
</td>
<td>
<bean:write name="list" property="hallid" />
</td>
<td>
<a href="#" onclick="fixTicket('<bean:write name='list' property='hallid' />','<bean:write name='list' property='filmdate' />')">订票</a>
</td>
</tr>
</logic:iterate>
</table>
</logic:present>
js代码: function reload(){
var table = document.getElementById("filmTable");
for(i=0;i<table.rows.length-1;i++){
for(j=i+1;j<table.rows.length;j++){
if(table.rows[i].cells[0].innerHTML==table.rows[j].cells[0].innerHTML){
table.rows[j].deleteCell(0);
table.rows[i].cells[0].rowSpan++;
if(table.rows[i].cells[1].innerHTML==table.rows[j].cells[0].innerHTML){
table.rows[j].deleteCell(0);
table.rows[i].cells[1].rowSpan++;
}
}
}
}
}
声明:JavaEye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
| |
| 返回顶楼 | |
收件箱(2)


